import React from "react";
import {Platform, StatusBar} from "react-native";
import {createNativeStackNavigator} from "@react-navigation/native-stack";
import {useTheme} from "@rn-vui/themed";
import PilotIndex from "../pages/pilot/PilotIndex.tsx";
import OrderList from "../pages/pilot/OrderList.tsx";

const Stack = createNativeStackNavigator();
const AppNavigator = () => {
    const theme = useTheme().theme;

    React.useLayoutEffect(() => {
        StatusBar.setBackgroundColor(theme.colors?.black);
    }, []);

    return (
        <Stack.Navigator
            screenOptions={{
                animation: Platform.select({
                    ios: "default",
                    android: "slide_from_right",
                }),
                statusBarStyle: "light",
                presentation: "card",
                headerTintColor: theme?.colors?.white,
                headerTitleStyle: {
                    fontSize: 18,
                },
                headerTitleAlign: 'center',
                headerStyle: {
                    backgroundColor: theme?.colors?.black,
                },
                contentStyle: {
                    backgroundColor: theme?.colors?.black,
                },
            }}
        >
            <Stack.Screen name={"PilotIndex"} component={PilotIndex}/>
            <Stack.Screen name={"OrderList"} component={OrderList}/>
        </Stack.Navigator>
    );
};

export default AppNavigator;
